import Vue from 'vue'
import Router from 'vue-router'
import routers from './router'

Vue.use(Router);

// const routerArr = router;
const originalReplace = Router.prototype.push
Router.prototype.push = function push(location){
  return originalReplace.call(this,location).catch(err =>err)
}


const router = new Router({
  // mode: 'history',
  routes: routers
})

//路由器跳转前置操作
// router.beforeEach((to, from, next) => {
// })

export default router
